
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:th="http://www.thymeleaf.org"
	xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity3">
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>美发店后台管理系统</title>
<!--Bootstrap-->
<link th:href="@{Bootstrap/bootstrap/css/bootstrap.min.css}"
	rel="stylesheet" />
<!-- Font Awesome -->
<link th:href="@{Bootstrap/font-awesome/css/font-awesome.min.css}"
	rel="stylesheet" />
<!--[if IE 7]>  
        <link href="/Content/font-awesome/css/font-awesome-ie7.min.css" rel="stylesheet" />  
        <![endif]-->
<link th:href="@{Bootstrap/sidebar-menu/sidebar-menu.css}"
	rel="stylesheet" />
<link th:href="@{Bootstrap/ace/css/ace-rtl.min.css}" rel="stylesheet" />
<link th:href="@{Bootstrap/ace/css/ace-skins.min.css}" rel="stylesheet" />
<link th:href="@{Bootstrap/toastr/toastr.min.css}" rel="stylesheet" />

<script th:src="@{Bootstrap/jquery-1.9.1.min.js}"></script>
<script th:src="@{Bootstrap/bootstrap/js/bootstrap.min.js}"></script>
<script th:src="@{Bootstrap/sidebar-menu/sidebar-menu.js}"></script>
<script th:src="@{Bootstrap/bootstrap/js/bootstrap-tab.js}"></script>
<!--[if lt IE 9]>  
        <script src="/Scripts/html5shiv.js"></script>  
        <script src="/Scripts/respond.min.js"></script>  
        <![endif]-->
<style type="text/css">
body {
	font-size: 12px;
}

.nav>li>a {
	padding: 5px 10px;
}

.tab-content {
	padding-top: 3px;
}
</style>
</head>
<body>
	<div class="navbar navbar-default" id="navbar">

		<ul class="navbar-header pull-left">

			<a class="fa fa-list-ul menu-toggler" id="menu-toggler" href="#">
				<i class="icon-reorder"
				style="font-size: 20px; margin-left: -18px; margin-top: 8px; display: flex;"></i>
			</a>

			<a href="#" class="navbar-brand"> <small> 美发店后台管理系统 </small>
			</a>
		</ul>
		<div class="navbar-header pull-right" role="navigation">
		<input type="hidden" th:value="@{${user.uid}}" id="uid">
			<ul class="nav ace-nav">

				<li class="light-blue" style="height: 50px;"><a
					data-toggle="dropdown" href="#" class="dropdown-toggle"> <!-- <img
						class="nav-user-photo" src="Content/ace/avatars/avatar2.png"
						alt="Admin's Photo" /> --> <span class="user-info"> <small>欢迎光临,</small>
							<strong th:text="@{${user.username}}"> </strong>
					</span> <i class="icon-caret-down"></i>
				</a>
					<ul
						class="user-menu pull-right dropdown-menu dropdown-yellow dropdown-caret dropdown-close">
						
						<li class="divider"></li>
						<li><a href="/logout"> <i class="icon-off"></i> 退出
						</a></li>
					</ul></li>
			</ul>
		</div>
	</div>

	<div class="main-container" id="main-container">
		<div class="main-container-inner">

			<div class="sidebar" id="sidebar">
				<div class="sidebar-collapse" id="sidebar-collapse"
					style="display: none;">
					<i class="icon-double-angle-left"
						data-icon1="icon-double-angle-left"
						data-icon2="icon-double-angle-right"></i>
				</div>
				<ul class="nav nav-list" id="menu"></ul>

			</div>
			<div class="main-content">
				<div class="page-content">
					<div class="row">
						<div class="col-xs-12" style="padding-left: 5px;">
							<ul class="nav nav-tabs" role="tablist">
								<li class="active"><a href="#Index" role="tab"
									data-toggle="tab">系统首页</a></li>
							</ul>
							<div class="tab-content" style="height: 800px">
								<div role="tabpanel" class="tab-pane active" id="Index"
									style="height: 100%">
									<h2>欢迎进入后台管理系统</h2>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>

		</div>

	</div>
	<script type="text/javascript">  
            //toastr.options.positionClass = 'toast-bottom-right';  
           
            $(function () {
                var uid= $('#uid').val();                  
                var target = $("#menu");
                target.addClass('nav');
                target.addClass('nav-list');
            	 $.getJSON("/selectMenuByUser?uid="+uid,function (data) {
            		 init2(target, data);
                	 });
            	 function init2(target,data){
            		
              	  /*  var obj = JSON.parse(data); */
                 		  $.each(data, function (i, item) {
                 			 
                               var li = $('<li></li>');
                               var a = $('<a></a>');
                               var icon = $('<i></i>');
                               icon.addClass('glyphicon');
                               
                               var text = $('<span></span>');
                               text.addClass('menu-text').text(item.menuName);
                               a.append(icon);
                               a.append(text);
                              
                               if (item.children.length != 0) {
                                   a.attr('href', '#');
                                   a.addClass('dropdown-toggle');
                                   var arrow = $('<b></b>');
                                   arrow.addClass('arrow').addClass('icon-angle-down');
                                   a.append(arrow);
                                   li.append(a);
                                   var menus = $('<ul></ul>');
                                   menus.addClass('submenu');
                                   init2(menus, item.children);
                                   li.append(menus);
                               }
                               else {
                                   
                                   var href = 'javascript:addTabs({id:\'' + item.menuId + '\',title: \'' + item.menuName+ '\',close: true,url: \'' + item.url + '\'});';
                                   
                                   a.attr('href', href);
                                   //if (item.istab)
                                   //    a.attr('href', href);
                                   //else {
                                   //    a.attr('href', item.url);
                                   //    a.attr('title', item.text);
                                   //    a.attr('target', '_blank')
                                   //}
                                   li.append(a);
                               }
                               target.append(li);
                           });

                     	  };
            	  
            	
                
            	
               /*  $('#menu').sidebarMenu({  
                    data: [{  
                        id: '1',  
                        text: '服务管理',  
                        icon: 'icon-cog',  
                        url: '',  
                        menus: [{  
                        	 id: '2',  
                            text: '服务类型',  
                            icon: 'icon-glass',  
                            url: '/tos'
                                },
                            {
                         	  id: '3',  
                              text: '服务项目',  
                              icon: 'icon-glass',  
                              url: '/service'  , 
                             
                        }]  
                        
                    },
                    {id: '4',  
                    text: '会员管理',  
                    icon: 'icon-cog',  
                    url: '',
                    menus: [{ id: '5',  
                            text: '会员卡类型',  
                            icon: 'icon-glass',  
                            url: '/tovip'},
                            { id: '6',  
                                text: '会员列表',  
                                icon: 'icon-glass',  
                                url: '/vip'},
                    
                    
                    ]
                    },
                    {id: '7',  
                        text: '用户管理',  
                        icon: 'icon-cog',  
                        url: '/userInfo',
                       
                        },
                     {id: '8',  
                            text: '菜单管理',  
                            icon: 'icon-cog',  
                            url: '/menu',
                           
                            },
                            {id: '9',  
                                text: '角色管理',  
                                icon: 'icon-cog',  
                                url: '/role',
                               
                                },] 
                });   */
      
                $("#menu-toggler").click(function () {  
                    var children = $("#sidebar-collapse").children("i");  
                    if ($(children).hasClass("icon-double-angle-left")) {  
                        $(children).removeClass("icon-double-angle-left").addClass("icon-double-angle-right");  
                        $("#sidebar").attr("class", "sidebar menu-min display");  
                    }  
                    else {  
                        $(children).removeClass("icon-double-angle-right").addClass("icon-double-angle-left");  
                        $("#sidebar").attr("class", "sidebar display");  
                    }  
                });  
            });  
        </script>
	<script th:src="@{Bootstrap/ace/js/ace-extra.min.js}"></script>
	<script th:src="@{Bootstrap/ace/js/ace.min.js}"></script>
</body>
</html>
